home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-02-27 | 1.2 KB | 39 lines | [TEXT/IGR0] |
- #include <Keyword-Value>
-
- | version 1.01
- Macro AppendImageToContour(plot,n)
- String plot
- Variable n=20
- Prompt plot,"contour plot",popup,ContourNameList("",";")
- Prompt n,"number of rows (and columns) for image"
-
- Silent 1;PauseUpdate
- String info=ContourInfo("",plot,0)
- String haxis= StrByKey("XAXIS",info)
- String vaxis= StrByKey("YAXIS",info)
- String xwave= StrByKey("XWAVE",info)
- String ywave= StrByKey("YWAVE",info)
- String zwave= StrByKey("ZWAVE",info)
- String flags= StrByKey("AXISFLAGS",info)
- String type=StrByKey("DATAFORMAT",info)
- Variable doContourZ= CmpStr(type,"XYZ") == 0
- | Make matrix that spans displayed X and Y
- String image=zwave
- if( doContourZ )
- image=CleanupName(image+"Image",1) // not necessarily a unique name
- Make/O/N=(n,n) $image // overwrite
- GetAxis/Q $haxis
- SetScale/I x, V_min, V_max, "",$image
- GetAxis/Q $vaxis
- SetScale/I y, V_min, V_max, "",$image
- $image= ContourZ("",plot,0,x,y)
- else // Matrix contour
- if( (strlen(xwave) + strlen(ywave)) > 0) // these grid waves won't work with images
- Abort "Can't append image because contour grid wave(s) don't work with image plots."
- endif
- endif
- String cmd
- sprintf cmd,"AppendImage%s %s",flags,PossiblyQuoteName(image)
- Execute cmd
- End
-